<?php

namespace App\Kuafu\Config\Controller\Applet;

use App\Kuafu\Config\Service\ConfigService;
use Illuminate\Http\Request;
use App\Kuafu\Base\Controller\BaseController;

class ConfigController extends BaseController
{
    /**
     * 根据type查询列表
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function getOrderRemark(Request $request)
    {
        $type = 'orderRemark';

        $lists = ConfigService::listByTypeAndKey($type);

        $return = [];
        // 临时做处理
        foreach ($lists as $key => $list) {
            if ((int)$key <= 10) {
                $return[] = $list;
            }
        }

        $data = [
            'lists' => $return,
        ];

        return $this->success($data);
    }
}
